<?php
/* Banner管理路由 */
Route::group(['prefix' => 'bannerIndex'], function () {
    /* 列表页路由 */
    Route::get('index', 'BannerIndexController@index')->name('bannerIndex.index');
    Route::post('table', 'BannerIndexController@table')->name('bannerIndex.table');
    Route::post('goodstable', 'BannerIndexController@goodstable')->name('bannerIndex.goodstable');
    Route::post('status', 'BannerIndexController@status')->name('bannerIndex.status');

    /* 编辑页路由 */
    Route::get('{id}/edit','BannerIndexController@edit')->where(['id' => '[0-9]+'])->name('bannerIndex.edit');
    Route::put('{id}','BannerIndexController@update')->where(['id' => '[0-9]+'])->name('bannerIndex.update');
    Route::put('updateField/{id}','BannerIndexController@updateField')->where(['id' => '[0-9]+'])->name('bannerIndex.updateField');
});

/* 启动广告设置路由 */
Route::group(['prefix' => 'beginBanner'], function () {
    Route::get('index', 'BeginBannerController@index')->name('beginBanner.index');
    Route::put('{id}','BeginBannerController@update')->where(['id' => '[0-9]+'])->name('beginBanner.update');
});

/* 正品保障路由 */
Route::group(['prefix' => 'qualityBanner'], function () {
    Route::get('index', 'QualityBannerController@index')->name('qualityBanner.index');
    Route::put('{id}','QualityBannerController@update')->where(['id' => '[0-9]+'])->name('qualityBanner.update');
});

/* 购买指南路由 */
Route::group(['prefix' => 'buyHelpBanner'], function () {
    Route::get('index', 'BuyHelpBannerController@index')->name('buyHelpBanner.index');
    Route::put('{id}','BuyHelpBannerController@update')->where(['id' => '[0-9]+'])->name('buyHelpBanner.update');
});

/* 营销模块路由 */
Route::group(['prefix' => 'activeBanner'], function () {
    /* 列表页路由 */
    Route::get('index', 'ActiveBannerController@index')->name('activeBanner.index');
    Route::post('table', 'ActiveBannerController@table')->name('activeBanner.table');
    Route::post('status', 'ActiveBannerController@status')->name('activeBanner.status');

    /* 编辑页路由 */
    Route::get('{id}/edit','ActiveBannerController@edit')->where(['id' => '[0-9]+'])->name('activeBanner.edit');
    Route::put('{id}','ActiveBannerController@update')->where(['id' => '[0-9]+'])->name('activeBanner.update');
});

/* 商品模块管理 */
Route::group(['prefix' => 'goodsHome'], function () {
    /* 列表页路由 */
    Route::get('index', 'GoodsHomeController@index')->name('goodsHome.index');
    Route::post('goodstable', 'GoodsHomeController@goodstable')->name('goodsHome.goodstable');

    /* 新增商品 */
    Route::post('goodstableAll', 'GoodsHomeController@goodstableAll')->name('goodsHome.goodstableAll');
    Route::post('{id}', 'GoodsHomeController@insertGood')->where(['id' => '[0-9]+'])->name('goodsHome.insertGood');
    Route::delete('{relation_id}', 'GoodsHomeController@deleteGood')->where(['relation_id' => '[0-9]+'])->name('goodsHome.deleteGood');

    /* 修改排序 */
    Route::post('sort/{id}', 'GoodsHomeController@sort')->where(['id' => '[0-9]+'])->name('goodsHome.sort');

    /* 编辑路由 */
    Route::put('{id}', 'GoodsHomeController@update')->where(['id' => '[0-9]+'])->name('goodsHome.update');

});

/* 充值记录 */
Route::group(['prefix' => 'rechargeRecord'], function () {
    /* 列表页路由 */
    Route::get('index', 'RechargeRecordController@index')->name('rechargeRecord.index');
    Route::post('table', 'RechargeRecordController@table')->name('rechargeRecord.table');
    Route::post('export', 'RechargeRecordController@export')->name('rechargeRecord.export');
});

/* 余额变动查询 */
Route::group(['prefix' => 'balanceChange'], function () {
    /* 列表页路由 */
    Route::get('index', 'BalanceChangeController@index')->name('balanceChange.index');
    Route::post('table', 'BalanceChangeController@table')->name('balanceChange.table');
    Route::post('export', 'BalanceChangeController@export')->name('balanceChange.export');
});

/* 充值产品 */
Route::group(['prefix' => 'rechargeQuick'], function () {
    /* 列表页路由 */
    Route::get('index', 'RechargeQuickController@index')->name('rechargeQuick.index');
    Route::post('table', 'RechargeQuickController@table')->name('rechargeQuick.table');
    Route::post('status', 'RechargeQuickController@status')->name('rechargeQuick.status');

    /* 编辑页路由 */
    Route::get('{id}/edit','RechargeQuickController@edit')->where(['id' => '[0-9]+'])->name('rechargeQuick.edit');
    Route::put('{id}','RechargeQuickController@update')->where(['id' => '[0-9]+'])->name('rechargeQuick.update');
    Route::put('updateField/{id}','RechargeQuickController@updateField')->where(['id' => '[0-9]+'])->name('rechargeQuick.updateField');
});

/* 账户充值 */
Route::group(['prefix' => 'accountRecharge'], function () {
    /* 列表页路由 */
    Route::get('index', 'AccountRechargeController@index')->name('accountRecharge.index');
    Route::post('info', 'AccountRechargeController@info')->name('accountRecharge.info');
    Route::post('recharge/{id?}', 'AccountRechargeController@recharge')->where(['id' => '[0-9]+'])->name('accountRecharge.recharge');
});

